<!DOCTYPE html>
<html>
<head>
    <title>热销展示表</title>
    <#include "/header.html">
</head>
<style>
    .el-table td, .el-table th {
        padding: 4px;
    }
    .el-table th {
        color: #0a8ddf;
    }
</style>
<body>
<div id="rrapp" v-cloak>
    <!--查询-->
    <el-form :inline="true" class="demo-form-inline" size="small">
        <el-form-item>
            <el-input v-model="q.goodsId" placeholder="请输入商品ID或名称"></el-input>
        </el-form-item>
        <el-form-item>
            <el-date-picker v-model="q.beginCreatetime" type="datetime" default-time="00:00:00"
                            value-format="yyyy-MM-dd HH:mm:ss" placeholder="创建开始时间">
            </el-date-picker>
        </el-form-item>
        <el-form-item>
            <el-date-picker v-model="q.endCreatetime" type="datetime" default-time="23:59:59"
                            value-format="yyyy-MM-dd HH:mm:ss" placeholder="结束时间">
            </el-date-picker>
        </el-form-item>
        <el-button type="primary" @click="search" plain size="small">查 询</el-button>&nbsp;&nbsp;&nbsp;&nbsp;
        <el-button type="primary" @click="reset" plain size="small">重 置</el-button>&nbsp;&nbsp;&nbsp;&nbsp;
        <el-button type="success" @click="add" size="small">新 增</el-button>
    </el-form>
    <!--查询结束-->

    <!--首页-->
    <template>
        <el-table border ref="singleTable" :data="goodsHotsell" highlight-current-row style="width: 100%">
            <el-table-column type="index" label="序号" index="indexMethod" width="60" align="center"></el-table-column>
            <el-table-column property="goodsId" label="商品ID" width="120" align="center"></el-table-column>
            <el-table-column property="name" label="商品名称" align="center"></el-table-column>
            <el-table-column property="showSort" label="推荐指数" align="center"></el-table-column>
            <el-table-column property="hotValue" label="热销指数" align="center"></el-table-column>
            <el-table-column property="createTime" label="创建时间" align="center"></el-table-column>
            <el-table-column label="操作" align="center">
                <template slot-scope="scope">
                    <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
                    <!--<el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>-->
                </template>
            </el-table-column>
        </el-table>
        <div class="block" align="center">
            <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="page.currentPage"
                    :page-sizes="page.pageSizes"
                    :page-size="page.pageSize"
                    layout="total, sizes, prev, pager, next, jumper"
                    :total="page.total">
            </el-pagination>
        </div>
    </template>

    <!--首页结束-->
    <!-- 新增/编辑 -->
    <el-dialog :title="title" :visible.sync="dialogFormVisible" width="480px" :before-close="closeChangeMachie">
        <el-form :model="hotsellFrom" ref="hotsellFrom" label-width="100px" center>
            <el-form-item v-show="hotsellFrom.id ==null" label="商品ID/名称" prop="goodsId"
                          :rules="[ { required: true, message: '内容不能为空'}]">
                <el-select v-model="hotsellFrom.goodsId" filterable remote style=" width: 340px;"
                           reserve-keyword placeholder="请输入商品关键词ID或名称"
                           :remote-method="remoteMethod" :loading="loading" clearable>
                    <el-option v-for="item in goodsList" :key="item.goodsId"
                               :label="(item.goodsId+' '+item.name.substring(0,20))"
                               :value="item.goodsId">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item v-show="hotsellFrom.id !=null" label="商品ID/名称">
                &nbsp;&nbsp;&nbsp;{{hotsellFrom.goodsId}} -- {{hotsellFrom.name}}
            </el-form-item>
            <el-form-item label="热度" prop="hotValue"
                          :rules="[ { required: true, message: '热度大于 0'}]">
                <el-input type="text" v-model="hotsellFrom.hotValue" placeholder="请输入大于   0 的整数"
                          clearable></el-input>
            </el-form-item>
            <el-form-item label="展示顺序" prop="showSort"
                          :rules="[ { required: true, message: '推荐展示顺序大于 0'}]">
                <el-input type="text" v-model="hotsellFrom.showSort" placeholder="请输入大于   0 的整数"
                          clearable></el-input>
            </el-form-item>

            <el-form-item center>
                <el-button type="primary" id="click1" @click="submitForm('hotsellFrom')" onclick="testButton()">提交
                </el-button>
                <el-button v-show="hotsellFrom.id !=null" @click="closeChangeMachie">取消</el-button>
                <el-button v-show="hotsellFrom.id ==null" @click="resetForm('hotsellFrom')">重置</el-button>
            </el-form-item>
        </el-form>
    </el-dialog>


</div>

<script src="${request.contextPath}/statics/js/modules/goods/goodshotsell.js?_${.now?long}"></script>
</body>
</html>